﻿using System.Collections.Generic;

namespace SlamCms.Configuration
{
	public class EnvironmentConfigurationConnectionStringDictionary : Dictionary<string, EnvironmentConfigurationConnectionString>
	{
		public EnvironmentConfigurationConnectionStringDictionary(EnvironmentConfiguration configuration)
		{
			configuration["ConnectionStrings.ConnectionString"].ForEach(c =>
				this.Add(c["Name"], new EnvironmentConfigurationConnectionString(c["Name"], c["ConnectionString"])));
		}
	}

	public class EnvironmentConfigurationConnectionString
	{
		public string ConnectionString { get; set; }
		public string Name { get; set; }

		public EnvironmentConfigurationConnectionString(string name, string connectionString)
		{
			Name = name;
			ConnectionString = connectionString;
		}
	}
}
